import { Component, OnInit } from '@angular/core';
import { LoginService } from './login.service';

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit {
  loginInfo: string;
  constructor(private loginService: LoginService) { }

  ngOnInit() {
    this.loginService.loginApi().then((res) => {
      // console.log(res);
      const data = res.json();
      if (data.errno === 0) {
        this.loginInfo = data.msg;
      }
    });

  }


}
